package org.rency.common.mq.enums;

/**
 * 消息格式
 * @author: user_rcy@163.com
 * </br>Created on 2016年4月8日
 * @version: V1.0.0
 * @since JDK 1.8
 */
public enum MessageFormat {

	OBJECT("OBJECT","对象"),
	JSON("JSON","JSON字符串"),
	TEXT("TEXT","文本"),
	MAP("MAP","Map集合"),
	BYTE_ARRAY("BYTE_ARRAY","字节数组"),
	;
	
	private String code;
	private String msg;
	
	MessageFormat(String code,String msg){
		this.code =code;
		this.msg = msg;
	}
	
	public String getCode(){
		return this.code;
	}
	
	public String getMsg(){
		return this.msg;
	}
	
	public static MessageFormat get(String code){
		for(MessageFormat nt : MessageFormat.values()){
			if(nt.getCode().toUpperCase().equals(code.toUpperCase())){
				return nt;
			}
		}
		return null;
	}

	
}